package org.nlp2rdf.navigator.component.resource.maps;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

import org.nlp2rdf.navigator.client.exception.NKEQueryException;
import org.nlp2rdf.navigator.component.exception.ComponentInitException;
import org.nlp2rdf.navigator.util.Prefixer;

public class MapLabelFromUri extends AbstractMap implements IMap {

	private Prefixer prefixer = null;

	@Override
	protected void _init() throws ComponentInitException {
		if (prefixer == null) {
			String msg = "prefixer not set MapLabelFromUri ";
			throw new ComponentInitException(msg);
		}
	}
	
	@Override
	public Map<String, String> getMap(Set<String> keys) throws NKEQueryException {
		check();
		Map<String, String> ret = new HashMap<String, String>();
		for (String key : keys) {
			ret.put(key, prefixer. nicen(key));
		}
		return ret;
	}

	

	public void setPrefixer(Prefixer prefixer) {
		this.prefixer = prefixer;
	}

}
